package com.alliky.user.ui.activity;

import android.os.Bundle;

import com.alliky.core.base.BaseActivity;
import com.alliky.core.util.RxToast;
import com.alliky.user.BR;
import com.alliky.user.R;
import com.alliky.user.databinding.ActivitySettingBinding;
import com.alliky.user.ui.viewmodel.SettingViewModel;

public class SettingActivity extends BaseActivity<ActivitySettingBinding, SettingViewModel> {

    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_setting;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public void initData() {
        mViewModel.initToolbar();
    }

    @Override
    public void initViewObservable() {
        super.initViewObservable();
//        mViewModel.uc.logout.observe(this, o -> new RxDialog.Builder(getSupportFragmentManager())
//                .setLayoutRes(R.layout.dialog_common_confirm_cancel)
//                .setScreenWidthAspect(getContext(), 0.75f)
//                .addOnClickListener(R.id.tv_cancel, R.id.tv_confirm)
////                    .setDialogAnimationRes(R.style.animate_dialog_scale)
//                .setOnBindViewListener(holder -> {
//                })
//                .setOnViewClickListener((holder, view1, tDialog) -> {
//                    int id = view1.getId();
//                    if (id == R.id.tv_cancel) {
//                        RxToast.warning("提交失败,用户名或密码错误");
//                        tDialog.dismiss();
//                    } else if (id == R.id.tv_confirm) {
//                        RxToast.normal("提交成功");
//                        tDialog.dismiss();
//                    }
//                })
//                .create()
//                .show());

        mViewModel.uc.logout.observe(this, o -> {
            RxToast.info("退出登录");
        });

    }
}